<section class="content-header">
    <ol class="breadcrumb">
        <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
        <li><a class="active">正式客户列表</a></li>
    </ol>
</section>
<section class="content">
    <div class="box box-danger">
        <div class="box-header">
            <h3 class="box-title"></h3>
            <div class="box-tools">
                <select 
                    name="search_type"  
                    class="form-control" 
                    ng-model="searchType" 
                    ng-change="searchTypeChange()" 
                    style="position: absolute;right: 240px;top: 0px;height: 30px;padding: 0px 12px;"
                >
                    <option value="name">按客户名称搜索</option>
                    <option value="contact">按联系人搜索</option>
                    <option value="tag">按标签搜索</option>
                </select>
                <div class="input-group input-group-sm" style="width: 236px;">
                    <input type="text" name="table_search" class="form-control pull-right" ng-model="search.name" ng-attr-placeholder="{{typePlaceholder}}">
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-default" ng-click="query()"><i class="fa fa-search"></i></button>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
                <tbody>
                    <tr>
                        <th style="width: 10px">#</th>
                        <!-- <th style="width: 90px;">客户编号</th> -->
                        <th>客户名称</th>
                        <!-- <th>联系人</th> -->
                        <!-- <th>联系电话</th> -->
                        <th>标签</th>
                        <th>业务员</th>
                        <th>助理1</th>
                        <th>助理2</th>
                        <th style="width: 90px;">客户来源</th>
                        <th>介绍人</th>
                        <th style="width: 80px;">订单数</th>
                        <th>创建日期</th>
                        <th class="opt-col">操作</th>
                    </tr>
                    <tr ng-repeat="item in data.items">
                        <td ng-bind="($index+1)+'.'"></td>
                         <!-- <td ng-bind="item.code"></td> -->
                        <td ng-bind="item.name"></td>
                        <!-- <td ng-bind="item.contact"></td> -->
                        <!-- <td ng-bind="item.mobile"></td> -->
                        <td ng-bind="item.tag"></td>
                        <td ng-bind="item.salesman"></td>
                        <td ng-bind="item.assistant_name"></td>
                        <td ng-bind="item.assistantNames"></td>
                        <td ng-bind="item.source"></td>
                        <td ng-bind="item.source_name"></td>
                        <td ng-bind="item.business_count"></td>
                        <td ng-bind="format(item.date_created, 'YYYY-MM-DD HH:mm')"></td>

                        <td class="opt-col">
                            <div class="btn-group">
                              <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-wrench"></i>
                              </button>
                              <ul class="dropdown-menu" role="menu">
                                <li><a class="fa fa-reply orange" ng-click="transferBack(item.id)"> 转为意向客户</a></li>
                                <li><a class="fa fa-info-circle" ui-sref="customer_view({id: item.id})"> 详情</a></li>
                                <li><a class="fa fa-pencil orange" ui-sref="customer_edit({id: item.id})"> 修改</a></li>
                                <li><a class="fa fa-clock-o green" ui-sref="customer_timeline({id: item.id})"> 查看日志</a></li>
                                <li><a class="fa fa-tags green" ng-click="onTag(item)"> 标签</a></li>
                              </ul>
                            </div>
                          </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="box-footer clearfix">
            <a ui-sref="customer_add" class="btn btn-sm btn-info btn-flat pull-left">新增客户</a>
            <a class="btn btn-sm btn-info btn-flat pull-left" style="margin-left: 10px;" ng-if="opers.indexOf(6) > -1" ng-click="export($event)">导出</a>
            <div pagination page-data="data.page" page-click="go(idx)"></div>
        </div>
    </div>
</section>
<div ui-view="tag"></div>